/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.third.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicModDictEnum;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;

/**
 * 第三方单位人员证书管理
 *
 * @author pig
 * @date 2024-01-11 10:17:25
 */
@Data
@TableName("base_third_employee_certificate")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "第三方单位人员证书管理")
public class BaseThirdEmployeeCertificateEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    /**
     * 第三方单位Id
     */
    @Schema(description = "第三方单位Id")
    private Long employerId;

    /**
     * 第三方单位员工Id
     */
    @Schema(description = "第三方单位员工Id")
    private Long employeeId;

    /**
     * 证书名称
     */
    @Schema(description = "证书名称")
    private String certificateName;

    /**
     * 证书状态
     */
    @Schema(description = "证书状态")
    private String certificateStatus;

    /**
     * 证书类型
     */
    @Schema(description = "证书类型")
    private String certificateType;

    /**
     * 证书编号
     */
    @Schema(description = "证书编号")
    private String certificateNum;

    /**
     * 证书有效日期
     */
    @Schema(description = "证书有效日期")
    private LocalDate effectiveDate;

    /**
     * 证书失效日期
     */
    @Schema(description = "证书失效日期")
    private LocalDate ineffectiveDate;

    /**
     * 备注说明
     */
    @Schema(description = "备注说明")
    private String remark;

    /**
     * 附件
     */
    @Schema(description = "附件")
    private String attachment;

    public String getEmployeeIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.third_employee, this.employeeId);
    }


    public String getEmployerIdStr() {
        return DictResolver.getItemLabelByValue(ParkBasicModDictEnum.third_unit, this.employerId);
    }

    public String getCertificateTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.certificate_type, this.certificateType);
    }

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
    }

}
